package com.yang.project.base.datatype;

import java.math.BigDecimal;

public class BigDecimalTest {
    public static void main(String[] args) {
        double a = 2.0 - 1.9;
        double b = 3.0 - 2.9;
        float c = 2.0f - 1.9f;
        float d = 3.0f - 2.9f;
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);
        System.out.println(d);
        System.out.println( a ==  b);
        System.out.println(c == d);

        //使用Decimal
        BigDecimal b1 = new BigDecimal("2.0");
        BigDecimal b2 = new BigDecimal("1.9");
        BigDecimal b3 = b1.subtract(b2);
        System.out.println(b3);
    }
}
